package cate.common.table.cross_boss.base;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;
import easy.java.dev.note.NoteField;

@EExcelRowClass(note = "跨服boss-基础 Row")
public class CrossBossFarmBaseRow extends ERow {
    @EExcelNoteField(fieldName = "boss实例")
    public String insCode;
    @EExcelNoteField(fieldName = "boss血量")
    public long maxHp;
    @EExcelNoteField(fieldName = "狂暴血量", defaultValue = "0")
    public long crazyHp;
    @EExcelNoteField(fieldName = "狂暴buff", defaultValue = "0")
    public int crazyBuff;
    @EExcelNoteField(fieldName = "击杀奖励")
    public String killRewardStr;
    @EExcelNoteField(fieldName = "挑战奖励")
    public String challengeRewardStr;
    @EExcelNoteField(fieldName = "组包掉落ID", defaultValue = "0")
    public int dropPackId;
    @EExcelNoteField(fieldName = "组包基础掉落概率", defaultValue = "0")
    public int dropBaseWeight;
//    @EExcelNoteField(fieldName = "组包奖励")
//    public String randomDropPack;
    @EExcelNoteField(fieldName = "奖励附加系数")
    public double rewardExtraParam;
    @EExcelNoteField(fieldName = "刷新时间")
    public long resetTimeSec;
    @EExcelNoteField(fieldName = "挑战条件")
    public String conditionStr;

    @NoteField("挑战条件-星级")
    public int conditionStar;
    @NoteField("挑战条件-数量")
    public int conditionNum;

//    @NoteField("额外掉落包")
//    public List<Pair<String, Integer>> dropPacks = new ArrayList<>();

    @Override
    public void decode() {
        super.decode();
        try {
            String[] parts = conditionStr.split(":");
            conditionStar = Integer.parseInt(parts[0]);
            conditionNum = Integer.parseInt(parts[1]);
        } catch (Exception e) {
            getContext().errorOnSheetDecoding(parent.getSheetName(), e);
        }
//        dropPacks.clear();
//        try {
//            String[] parts = randomDropPack.split("#");
//            for (String packStr : parts) {
//                int pos = packStr.lastIndexOf(":");
//                String rewardStr = packStr.substring(0, pos);
//                int param = Integer.parseInt(packStr.substring(pos + 1));
//                Pair<String, Integer> pair = Pair.create(rewardStr, param);
//                dropPacks.add(pair);
//            }
//        } catch (Exception e) {
//            getContext().errorOnSheetDecoding(parent.getSheetName(), e);
//        }
    }
}
